import Vue from 'vue'
import VueRouter from 'vue-router'
import MinitUI from 'mint-ui'
import 'mint-ui/lib/style.css'
import App from './App.vue'
import axios from 'axios'

axios.defaults.timeout = 5000;// 在超时前，所有请求都会等待 5 秒
axios.defaults.headers.post['Content-Type']= 'application/json';// 配置请求头
axios.defaults.baseURL = 'http://localhost:8080/websit/query';// 配置接口地址
axios.defaults.withCredentials = false;

Vue.prototype.$axios = axios;// 将axios配置成vue的原型

Vue.config.productionTip = false
Vue.use(MinitUI)
Vue.use(VueRouter)

/*引入模块*/
import Index from './components/Index'
import Login from './components/Login'

const routes = [
    { path: '/', component: Index },
    { path: '/login', component: Login }
]

const router = new VueRouter({
    routes // (缩写) 相当于 routes: routes
})

new Vue({
    render: h => h(App),
    router
}).$mount('#app')
